package com.coding.springboot.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by qince on 2015/8/3.
 */
@Controller
@RequestMapping(value = "/wap/wxtest")
public class WxTestController {

    @RequestMapping(value = "/auth")
    public String authentication() {
        return "/authentication";
    }

    @RequestMapping(value = "/share")
    public String share(HttpServletRequest request,Model model) {
        String openid = request.getParameter("openid");
        String nickname = request.getParameter("nickname");
        String headimg = request.getParameter("headimg");
        System.out.println("openid:" + openid + ",nickname:" + nickname + ",headimg:" + headimg);

        model.addAttribute("openid",openid);
        model.addAttribute("nickname",nickname);
        model.addAttribute("headimg",headimg);
        return "/share";
    }
}
